<template>

    <view>
        <van-cell title="台站信息" is-link @click="navigateToStation(stationCode)"></van-cell>
        <van-cell title="巡检记录" is-link @click="navigateToCheckRecords(stationCode)"></van-cell>
        <van-cell title="抢修记录" is-link @click="navigateToRepairRecords(stationCode)"></van-cell>
        <van-cell title="问题反馈" is-link @click="navigateToQuestionRecords(stationCode)"></van-cell>
    </view>
    
</template>

<script>
    export default {
        name: "StationMenu",
        data() {
            return {
                stationCode: '',
                windowWidth: '375px',
                windowHeight: '667px',
            }
        },
        onLoad: function(options) {
            this.windowWidth = options.windowWidth
            this.windowHeight = options.windowHeight
            this.stationCode = options.stationCode
        },
        methods: {
            // 跳转至台站详情页面
            navigateToStation(stationCode) {
                uni.navigateTo({
                    url: '/pages/station/StationInfo?windowHeight=' + this.windowHeight + '&windowWidth=' + this.windowWidth + '&stationCode=' + stationCode
                })
            },

            // 跳转至巡检记录列表页面，并过滤该Station的所有巡检记录
            navigateToCheckRecords(stationCode) {
                uni.navigateTo({
                    url: '/pages/check/CheckRecordMain?windowHeight=' + this.windowHeight + '&windowWidth=' + this.windowWidth+ '&stationCode=' + stationCode
                })
            },

            // 跳转至抢修记录页面
            navigateToRepairRecords(stationCode) {
                uni.navigateTo({
                    url: '/pages/repair/RepairRecordMain?windowHeight=' + this.windowHeight + '&windowWidth=' + this.windowWidth + '&stationCode=' + stationCode
                })
            },

            // 跳转至问题反馈列表
            navigateToQuestionRecords(stationCode) {
                uni.navigateTo({
                    url: '/pages/question/QuestionFeedbackMain?windowHeight=' + this.windowHeight + '&windowWidth=' + this.windowWidth + '&stationCode=' + stationCode
                })
            }
        }
    }
</script>

<style scoped>

</style>